/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package stage;

import java.io.*;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.GeometryCollection;
import com.vividsolutions.jts.geom.Coordinate;
import java.util.Vector;
import com.vividsolutions.jts.geom.IntersectionMatrix;

/**
 *
 * @author matteo
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        String path1 = "/home/matteo/Documenti/prove_jml/prova_poligoni.jml";
        String path2 = "/home/matteo/Documenti/prove_jml/prova_poligoni5.jml";
        //System.out.println(ElaborazioneFile.tipoFigura(path));

//        String s = "";
//
//        int contatore_prova = 0;

        //Vector v;
//        Vector gc1 = new Vector();
//
//        gc2.add(0,1);
//

//        gc1 = ElaborazioneFile.geomArray(path1);
//        gc2 = ElaborazioneFile.geomArray(path2);

//        GeometryContainer gc;

        // Prova join tra oggetti

//        GeometryContainer a1 = (GeometryContainer)gc1.elementAt(0);
//        GeometryContainer b1 = (GeometryContainer)gc2.elementAt(0);
//
//        Geometry a = a1.getGeometry();
//        Geometry b = b1.getGeometry();
//        Geometry app = a.intersection(b);
//        System.out.println("Area a : "+a.toText());
//        System.out.println("Area b : "+b.toText());
//        System.out.println("Polygon instersezione : "+app.toText());
//        System.out.println("Area intersezione : "+app.getArea());

        //System.out.println("Dimensione di v:"+gc.isEmpty());

        //for( int i = 0; i < gc.getLength() - 1; i++ )
         //System.out.println("Contenuto di gc[] : "+gc.toString());

        /*try {
            File file = new File(path);
            FileReader fr = new FileReader(file);
            BufferedReader br = new BufferedReader(fr);

            s = br.readLine();
            while (s != null) {
                System.out.println("" + s);

                double x = 0.0;
                double y = 0.0;

                Double[] xy = new Double[2];
                boolean appena_uscito = false;
                if (ElaborazioneFile.trovaParola(s, "gml:coordinates")) {

                    while (!(ElaborazioneFile.trovaParola(s, "/gml:coordinates"))) {
                        System.out.println("" + s);
                        xy = ElaborazioneFile.trovaCoordinate(s);
                        System.out.println("x: " + xy[0] + " y: " + xy[1]);
                        s = br.readLine();
                    }
                    appena_uscito = true;
                }//end if

                if (appena_uscito) {
                    //System.out.println("s="+s);
                    xy = ElaborazioneFile.trovaCoordinate(s);
                    System.out.println("x: " + xy[0] + " y: " + xy[1]);
                    appena_uscito = false;
                }

                s = br.readLine();

            }//end while

            fr.close();
            br.close();
        } catch (IOException e) {
            System.out.println("" + e);
        }


        Coordinate coordinata;
        */



    }//end main
}//end class

